#include"pollServer.hpp"
#include<memory>

using namespace std;
using namespace poll_ns;
static void Usage(std::string proc)
{
    std::cerr<<"Usage:\n\t" <<proc <<" port"<<std::endl;
}



std::string transaction(const string& request)
{
    return request;
}



// ./select_server 8080
int main(int argc,char* argv[])
{
    if(argc != 2)
    {
        Usage(argv[0]);
        return USAGE_ERR;
    }
    unique_ptr<PollServer> svr(new PollServer(transaction,atoi(argv[1])));

    svr->initServer();

    svr->start();
    // std::cout << "fd_set_size: " <<sizeof(fd_set) <<std::endl;


    return 0;
}